package com.myhome.mappers;

import com.myhome.domain.UserBank;
import com.myhome.dto.BankDto;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @Author QYiXin
 * @Date 2021 10 27 08 48
 **/
@Mapper(componentModel = "spring")
public interface UserBankDtoMapper {

    UserBankDtoMapper INSTANCE = Mappers.getMapper(UserBankDtoMapper.class);
    /**
     * 将entity转化为dto
     *
     * @param source
     * @return
     */
    BankDto convert2Dto(UserBank source);

    /**
     * 将dto对象转化为entity对象
     *
     * @param source
     * @return
     */
    UserBank convert2Entity(BankDto source);


    /**
     * 将entity转化为dto
     *
     * @param source
     * @return
     */
    List<BankDto> convert2Dto(List<UserBank> source);

    /**
     * 将dto对象转化为entity对象
     *
     * @param source
     * @return
     */
    List<UserBank> convert2Entity(List<BankDto> source);
}
